from db.redis import StrictRedis
from multiprocessing import Process

# 192.168.88.131


def op():
    sr = StrictRedis(host='192.168.88.131', db="0")
    while True:
        da = sr.rpop("data")
        if not (da is None):
            print(da)


def ins():
    sr = StrictRedis(host='192.168.88.131', db=0)
    for i in range(0, 100):
        sr.lpush("data", i)


if __name__ == '__main__':
    for i in range(0, 5):
        a = Process(target=op)
        a.start()

    for i in range(0, 2):
        b = Process(target=ins)
        b.start()

    while True:
        pass